Skip to content

scope proxy credentials to the proxy in HTTPProxyConfigurator - #1327

Open
kali834x wants to merge 1 commit into
apache:masterfrom
kali834x:proxy-credentials-scope
Open

kali834x wants to merge 1 commit into
apache:masterfrom
kali834x:proxy-credentials-scope

Conversation

@kali834x

@kali834x kali834x commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

HTTPProxyConfigurator.configure registered the proxy username and password under AuthScope(null, -1), the any-host scope, on the credentials provider that HttpClient 5 also consults for an origin server's 401. a server reached through the proxy, or any host a redirect lands on, could answer a repeatable request (GET, DELETE, an unchunked POST or one with allowedRetry) with a Basic challenge and get Authorization: Basic proxyuser:proxypass on the retry, inside its own TLS session when tunnelled. configure also replaced the provider that RequestImpl.enableAuthentication had already filled, so with both configured the origin was given the proxy password instead of its own. scope the credentials to the proxy host and port and add them to the existing BasicCredentialsProvider; ProxyCredentialScopeTest drives RequestImpl through a stub proxy with a real HttpClient and fails on master for both the origin 401 and the overridden origin credentials, while the proxy's 407 is still answered. HTTPProxyConfiguratorTest in modules/integration now also asserts an origin scope gets no credentials.

The proxy username and password were registered under AuthScope(null, -1),
which HttpClient also consults for an origin server's 401 challenge, so a
server reached through the proxy could collect the proxy password with a
Basic challenge. Scope the credentials to the proxy host and port, and add
them to a credentials provider the request already carries instead of
replacing it, so origin credentials set through enableAuthentication survive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant